<?php
	header('content-type:text/html;charset=utf-8');
	$link = @mysql_connect('localhost','root','');

	if(!$link){
		die('数据库连接失败！');
	}

	mysql_query('set names utf8');
	mysql_query('use st');  
	  
	$sql="select * from buy where bTitle = '渠道代理'";//寻找表里的标题

        if(!empty($_GET['buy'])){
            $buy=$_GET['buy'];
            $sql="select * from buy where bTitle = '{$buy}'";
        }//判断是否有值，如果有，就执行。没有就执行下一个

		$result = mysql_query($sql,$link);//执行上面的sql语句 
	   while ($row = mysql_fetch_assoc($result)) {
	   		$buy2[]= $row;
		}//循环



      
	require 'buy_html.php';

?>